<?php

namespace app\api\validate;

use think\Validate;

class Base extends Validate
{
    protected $rule = [
        'token' => 'require|checkToken:thinkphp',
    ];

    // 自定义验证规则
    protected function checkToken($value, $rule, $data = [])
    {
        return cache($value) ? true : 'Token错误';
    }
}